#!/usr/bin/env bash
#
# Script to fetch the source code for docker-ffmpeg-compiler, build the image, copy the relevant binaries to the current working directory, and delete the image.
#
git clone https://gitee.com/hocker/docker-ffmpeg-compiler.git
cd docker-ffmpeg-compiler
nerdctl build -t ffmpeg-compiler .
nerdctl run --rm -it -v $(pwd):/host ffmpeg-compiler bash -c "cp /root/bin/ffmpeg /root/bin/ffprobe /host && chown $(id -u):$(id -g) /host/ffmpeg && chown $(id -u):$(id -g) /host/ffprobe"
nerdctl rmi -f ffmpeg-compiler
